← Index
NYTProf Performance Profile   
For starman worker -M FindBin --max-requests 50 --workers 2 --user=kohadev-koha --group kohadev-koha --pid /var/run/koha/kohadev/plack.pid --daemonize --access-log /var/log/koha/kohadev/plack.log --error-log /var/log/koha/kohadev/plack-error.log -E deployment --socket /var/run/koha/kohadev/plack.sock /etc/koha/sites/kohadev/plack.psgi
  Run on Fri Jan 8 14:31:06 2016
Reported on Fri Jan 8 14:33:30 2016

Filename(eval 1230)[/usr/share/perl5/CGI/Compile.pm:12]
StatementsExecuted 15 statements in 512µs
Eval Invoked At/usr/share/perl5/CGI/Compile.pm line 12
Sibling evals1, 2
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11137µs63µsCGI::Compile::ROOT::home_vagrant_kohaclone_mainpage_2epl::::BEGIN@2CGI::Compile::ROOT::home_vagrant_kohaclone_mainpage_2epl::BEGIN@2
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
11700nspackage CGI::Compile::ROOT::home_vagrant_kohaclone_mainpage_2epl;sub {local $CGI::Compile::USE_REAL_EXIT = 0;
214511µs5170µs
# spent 63µs (37+26) within CGI::Compile::ROOT::home_vagrant_kohaclone_mainpage_2epl::BEGIN@2 which was called: # once (37µs+26µs) by CGI::Compile::_eval at line 2
CGI::initialize_globals() if defined &CGI::initialize_globals;local ($0, $CGI::Compile::_dir, *DATA);{ my ($data, $path, $dir) = @_[1..3];$0 = $path;$CGI::Compile::_dir = File::pushd::pushd $dir;open DATA, '<', \$data;}local @SIG{keys %SIG} = do { no warnings 'uninitialized'; @{[]} = values %SIG };local $^W = 0;my $rv = eval {local @ARGV = @{ $_[4] };local @_ = @{ $_[4] };
# spent 63µs making 1 call to CGI::Compile::ROOT::home_vagrant_kohaclone_mainpage_2epl::BEGIN@2 # spent 53µs making 1 call to File::pushd::pushd # spent 26µs making 1 call to warnings::unimport # spent 18µs making 1 call to CGI::initialize_globals # spent 10µs making 1 call to CGI::Compile::ROOT::home_vagrant_kohaclone_mainpage_2epl::CORE:open
3#line 1 /home/vagrant/kohaclone/mainpage.pl
4#!/usr/bin/perl
5
6# This file is part of Koha.
7#
8# Copyright Paul Poulain 2002
9# Parts Copyright Liblime 2007
10# Copyright (C) 2013 Mark Tompsett
11#
12# Koha is free software; you can redistribute it and/or modify it
13# under the terms of the GNU General Public License as published by
14# the Free Software Foundation; either version 3 of the License, or
15# (at your option) any later version.
16#
17# Koha is distributed in the hope that it will be useful, but
18# WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20# GNU General Public License for more details.
21#
22# You should have received a copy of the GNU General Public License
23# along with Koha; if not, see <http://www.gnu.org/licenses>.
24
25use Modern::Perl;
26use CGI qw ( -utf8 );
27use C4::Output;
28use C4::Auth;
29use C4::Koha;
30use C4::NewsChannels; # GetNewsToDisplay
31use C4::Review qw/numberofreviews/;
32use C4::Suggestions qw/CountSuggestion/;
33use C4::Tags qw/get_count_by_tag_status/;
34use Koha::Borrower::Modifications;
35use Koha::Borrower::Discharge;
36
37my $query = new CGI;
38
39my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
40 {
41 template_name => "intranet-main.tt",
42 query => $query,
43 type => "intranet",
44 authnotrequired => 0,
45 flagsrequired => { catalogue => 1, },
46 }
47);
48
49my $homebranch;
50if (C4::Context->userenv) {
51 $homebranch = C4::Context->userenv->{'branch'};
52}
53my $all_koha_news = &GetNewsToDisplay("koha",$homebranch);
54my $koha_news_count = scalar @$all_koha_news;
55
56$template->param(
57 koha_news => $all_koha_news,
58 koha_news_count => $koha_news_count
59);
60
61my $branch =
62 ( C4::Context->preference("IndependentBranchesPatronModifications")
63 || C4::Context->preference("IndependentBranches") )
64 && !$flags->{'superlibrarian'}
65 ? C4::Context->userenv()->{'branch'}
66 : undef;
67
68my $pendingcomments = numberofreviews(0);
69my $pendingtags = get_count_by_tag_status(0);
70my $pendingsuggestions = CountSuggestion("ASKED");
71my $pending_borrower_modifications =
72 Koha::Borrower::Modifications->GetPendingModificationsCount( $branch );
73my $pending_discharge_requests = Koha::Borrower::Discharge::count({ pending => 1 });
74
75$template->param(
76 pendingcomments => $pendingcomments,
77 pendingtags => $pendingtags,
78 pendingsuggestions => $pendingsuggestions,
79 pending_borrower_modifications => $pending_borrower_modifications,
80 pending_discharge_requests => $pending_discharge_requests,
81);
82
83#
84# warn user if he is using mysql/admin login
85#
86unless ($loggedinuser) {
87 $template->param(adminWarning => 1);
88}
89
90output_html_with_http_headers $query, $cookie, $template->output;
91
92};
93 my $self = shift;
94 my $exit_val = unpack('C', pack('C', sprintf('%.0f', $rv)));
95 if ($@) {
96 die $@ unless (
97 ref($@) eq 'ARRAY' and
98 $@->[0] eq "EXIT\n"
99 );
100 my $exit_param = unpack('C', pack('C', sprintf('%.0f', $@->[1])));
101
102 if ($exit_param != 0 && !$CGI::Compile::RETURN_EXIT_VAL && !$self->{return_exit_val}) {
103 die "exited nonzero: $exit_param";
104 }
105
106 $exit_val = $exit_param;
107 }
108
109 return $exit_val;
110 };
111;